﻿using System;
using System.ComponentModel.Composition.Hosting;
using System.IO;

namespace Mefisto4.Core.MEF
{
    public static class ContainerManager
    {
        private static CompositionContainer _container;
        public static CompositionContainer ApplicationContainer
        {
            get
            {
                if (_container == null)
                {
                    var catalog = new DirectoryCatalog(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bin"));
                    _container = new CompositionContainer(catalog);
                }
                return _container;
            }
        }
    }
}